import { useRouter } from 'vue-router'

export default function useBack() {
  const router = useRouter()
  function back() {
    if (window.history.state.back === null) {
      router.replace('/match');
    } else {
      router.back();
    }
  }
  return { back };
}
